<template>
  <el-dialog
    title="题目审核"
    :visible="checkVisible"
    @close="close"
    width="400px"
  >
    <el-radio v-model="chkState" label="1">通过</el-radio>
    <el-radio v-model="chkState" label="2">拒绝</el-radio>
    <el-input
      type="textarea"
      :autosize="{ minRows: 2, maxRows: 4 }"
      placeholder="请输入内容"
      v-model="chkRemarks"
      style="width: 100%;margin-top:20px;"
    >
    </el-input>
    <div slot="footer" class="dialog-footer">
      <el-button @click="close">取 消</el-button>
      <el-button type="primary" @click="onSubmit">确 定</el-button>
    </div>
  </el-dialog>
</template>

<script>
import { choiceCheck } from '@/api/hmmm/questions.js'
export default {
  name: 'QuestionsCheck',
  data () {
    return {
      chkRemarks: '',
      chkState: '1',
      rowList: {}
    }
  },
  props: {
    checkVisible: {
      type: Boolean,
      required: true
    }
  },
  methods: {
    close () {
      this.$emit('update:checkVisible', false)
      this.chkRemarks = ''
    },
    async onSubmit () {
      await choiceCheck({ id: this.rowList.id, chkRemarks: this.chkRemarks, chkState: Number(this.chkState) })
      this.$message({ type: 'success', message: '审核成功' })
      this.close()
      this.$emit('updataCheck')
    }
  }
}
</script>

<style scoped lang='less'></style>
